package cn.com.webConfiguration;


import cn.com.interceptor.AuthInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@Configuration
public class InterceptorConfig extends WebMvcConfigurerAdapter{

    @Bean
    public AuthInterceptor getAuthInterceptor(){
        return new AuthInterceptor();
    }

    public void addInterceptors(InterceptorRegistry register){
        register.addInterceptor(getAuthInterceptor()).addPathPatterns("/front/**","/back/**","/operation/**");
    }
}
